package persistencia.cv;

import java.sql.ResultSet;
import java.sql.SQLException;
import java.util.Collection;

import negocio.cv.Exigencia;
import negocio.cv.Idioma;

import persistence.DBManager;

public class DAOIdioma implements DAOInterface {

	public static final int CV=0;
	public static final int PERFIL=1;

	private DBManager manager;

	public DAOIdioma(DBManager manager) {
		this.manager = manager;
	}
	@Override
	public void delete(Object b) {
		// TODO Auto-generated method stub

	}

	@Override
	public Idioma get(String businessId) {
		Idioma i = null;
		ResultSet rs = null;
		String query;
		int id = Integer.parseInt(businessId);
		try {
			query = "call tesis.idioma_get("+id+",@nombre)";
					
			rs = manager.openCallableQuery(query);
			rs.first();	
			i=new Idioma(rs.getObject(1).toString());
			i.setIdIdioma(id);

		} catch (SQLException exc) {
			exc.printStackTrace();
		}
		return i;
	}

	@Override
	public Collection getAll() {
		// TODO Auto-generated method stub
		return null;
	}

	@Override
	public int insert(Object b) {
		// TODO Auto-generated method stub
		return 0;
	}

	@Override
	public void update(Object b) {
		// TODO Auto-generated method stub

	}

}
